With popularization and development of a network, information exchange between an application in a terminal and a server becomes increasingly frequent. To implement functions such as analysis, statistics collection, or charging of a data stream generated by an application, an application to which a data stream belongs needs to be determined.
Currently, an application to which a data stream belongs is generally identified according to a protocol type of the data stream. After a data stream is received, an application to which the data stream belongs is identified according to a feature code included in a protocol of the data stream. If applications are independent of each other, a belonging relationship between a data stream and an application can be correctly determined using this identifying method.
However, a mutual nesting relationship generally exists between different applications. That is, a second application is nested on a page of a first application, for example, a video clip on the YouTube® website can be watched on a Facebook® web page, and an online game that is provided by a third-party game company can be played on a Facebook® homepage. In this way, when the second application is enabled on the page of the first application, a data stream generated by the second application is generated on the page of the first application. Therefore, the data stream generated by the second application should belong to the first application. However, if an existing data stream identifying manner is adopted, an identification code included in a protocol of the data stream generated by the second application indicates that the data stream belongs to the second application. Therefore, an identification error occurs.
It may be learned that in a case in which there exists a nesting relationship between applications, there is a high identification error rate problem when the existing identifying manner is used. Therefore, a correspondence between an application and a data stream cannot be obtained correctly, thereby failing to provide correct basic data for subsequent functions, such as analysis, statistics collection, or charging.